package org.zsk.cfl.authagency;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Date;

/**
 * 授权代表关系边
 * @author zsk
 * 1/9/21 11:19 AM
 */
@Data
@AllArgsConstructor
public class AuthAgencyEdge {
    /**
     * 授权代办id
     */
    private String authId;
    /**
     * 授权类型：（00-按人，01-按模型）
     */
    private String type;
    /**
     * 是否仅授权自身任务
     */
    private boolean onlySelfTask;
    /**
     * 授权开始时间
     */
    private Date authStartTime;
    /**
     * 授权结束时间
     */
    private Date authEndTime;

    @Override
    public int hashCode() {
        int result= authId.hashCode();
        result=37*result+type.hashCode();
        result=37*result+authStartTime.hashCode();
        result=37*result+authEndTime.hashCode();
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof AuthAgencyEdge)){
            return false;
        }
        AuthAgencyEdge authAgencyEdge= (AuthAgencyEdge) obj;
        if (this==authAgencyEdge){
            return true;
        }
        return authAgencyEdge.authId.equals(this.authId)
                && authAgencyEdge.type.equals(this.type)
                && authAgencyEdge.authStartTime.equals(this.authStartTime)
                && authAgencyEdge.authEndTime.equals(this.authEndTime);
    }
}

